package com.gljx.web.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gljx.web.Entity.FillingCard;
import com.gljx.web.dao.CommonDao;
import com.gljx.web.dao.FillingCardMapper;
import com.gljx.web.service.FillingCardService;

@Service
@Transactional
public class FillingCardServiceImpl extends CommonDao implements FillingCardService{

	
	@Autowired
	private FillingCardMapper fillingCardMapper;
	
	/**
	 * 实现根据公司查询
	 */
	@Override
	public List<FillingCard> queryFillingCard(String companyId) {
		// TODO Auto-generated method stub
		return fillingCardMapper.selectFillingCard(companyId);
	}
	
	/**
	 * 实现根据公司和名称查询
	 */
	@Override
	public List<FillingCard> selectFillingCardByfnameL2(String companyId, String fnameL2) {
		// TODO Auto-generated method stub
		Map<String, String>map = new HashMap<String, String>();
		map.put("companyId", companyId);
		map.put("fnameL2", fnameL2);
		return fillingCardMapper.selectFillingCardByfnameL2(map);
	}

	/**
	 * 获取上一个编码
	 */
	@Override
	public String selectFnumber(String companyId) {
		// TODO Auto-generated method stub
		return fillingCardMapper.selectFnumber(companyId);
	}

	/**
	 * 实现添加方法
	 */
	@Override
	public void addFillingCard(FillingCard fillingCard) {
		// TODO Auto-generated method stub
		fillingCardMapper.insertSelective(fillingCard);
	}

	/**
	 * 实现根据fid查询
	 */
	@Override
	public FillingCard selectByPrimaryKey(String fid) {
		// TODO Auto-generated method stub
		return fillingCardMapper.selectByPrimaryKey(fid);
	}

	/**
	 * 实现修改
	 */
	@Override
	public void modifyFillingCard(FillingCard fillingCard) {
		// TODO Auto-generated method stub
		fillingCardMapper.updateByPrimaryKeySelective(fillingCard);
	}

	/**
	 * 实现删除方法
	 */
	@Override
	public void deleteFillingCardByFiD(String fid) {
		// TODO Auto-generated method stub
		fillingCardMapper.deleteByPrimaryKey(fid);
	}

}
